package com.example.lanqiaodemo1.JavaTest4;



public class RectangleClass extends ShapeClass{
    public double x;
    public double y;
    public RectangleClass(double x, double y) {
        this.x = x;
        this.y = y;
    }
    public RectangleClass() {}
    @Override
    public double getArea() {
        return x*y;
    }
    @Override
    public double getPerimeter() {
        return (x+y)*2;
    }
}
class test4{
    public static void main(String[] args) {
        RectangleClass rectangle = new RectangleClass(1,2);
        System.out.println(rectangle.getArea());
        System.out.println(rectangle.getPerimeter());
    }
}